<?php echo $this->render('head.html');?>

<div id="body">

<?php echo $this->render('left.html'); ?>
<?php switch($this->x) : ?>
<?php case 'single' : ?>
<div id="postwrapper">
<div class="calwrap">
<div class="caltop"><?php echo date('Y.m',$this->posttime); ?></div>
<div class="calbottom"><?php echo date('d',$this->posttime); ?></div>
</div>
<div class="posttop">
<h1 class="pt"><?php echo $this->title; ?></a></h1><div class="edit"><img src="<?php echo $this->baseUrl(); ?>/public/imgs/edit.gif"  /></div>
<a href="" class="user">Author:<?php echo $this->author; ?></a><a href="" class="cat">Hit(<?php echo $this->viewnums; ?>)</a> <a href="" class="com">Comments (<?php echo $this->commnums; ?>)</a>
</div>
<div class="post">
<?php echo $this->content; ?></a>
</div>
<div class="postbottom"><a href="" class="email">Replay</a></div>
<ul class="commentlist" id="commentlist">
<?php foreach($this->comment as $key){ ?>
	<li class="alt"  >
		<p><?php echo $this->escape($key['name']); ?>|<?php echo date('Y-m-d H:i:s',$key['posttime']); ?></p>
		<?php echo $this->escape($key['content']); ?>
	</li>
<?php } ?>
</ul>

<h1>Comments</h1>
			<form method="Post" action="<?php echo $this->baseUrl(); ?>/index/comment/">			
			<p>		
				<label>Name</label><input type="hidden" name="blogid" value="<?php echo $this->id; ?>" />
				<input style="background-color: rgb(255, 255, 160);" name="name" size="30" type="text" />*长度为25个字符

				<label>Email</label>
				<input style="background-color: rgb(255, 255, 160);" name="email"  size="30" type="text" />*必填(不公开)
				<label>Your Comments</label>
				<textarea rows="5" cols="5" name="content"></textarea>
				<br />	
				<input type="submit" name="submit" value="提交"/>		
			</p>		
</form>	
</div>
</div>
</div>
<?php break; ?>
<?php case 'double' : ?>
<div id="postwrapper">
<?php foreach($this->paginator as $key){ ?>
<div class="calwrap">
<div class="caltop"><?php echo date('Y.m',$key['posttime']); ?></div>
<div class="calbottom"><?php echo date('d',$key['posttime']); ?></div>
</div>
<div class="posttop">
<h1 class="pt"><a href="<?php echo $this->baseUrl(); ?>/index/single/id/<?php echo $this->escape($key['id']) ?>"><?php echo $this->escape($key['title']) ?></a></h1><div class="edit"><a href=""><img src="<?php echo $this->baseUrl(); ?>/public/imgs/edit.gif"  /></a></div>
<a href="" class="user">Author:<?php echo $this->escape($key['author']) ?></a><a href="" class="cat">Hit(<?php echo $this->escape($key['viewnums']) ?>)</a> <a href="" class="com">Comments (<?php echo $this->escape($key['commnums']) ?>)</a>
</div>
<div class="post">
<a href="<?php echo $this->baseUrl(); ?>/index/single/id/<?php echo $this->escape($key['id']) ?>" style="TEXT-DECORATION:none"><?php echo mb_substr($key['content'],0,400,'utf-8'); ?></a>
</div>
<div class="postbottom"><a href="" class="email">Replay</a></div>
<?php } ?>
<div class="postnav">
 <?php echo $this->paginationControl($this->paginator, 'Sliding', 'page.phtml'); ?>
</div>
</div>
</div>
</div>
<?php break; ?>
<?php default : ?>
<div id="postwrapper">
<?php foreach($this->paginator as $key){ ?>
<div class="calwrap">
<div class="caltop"><?php echo date('Y.m',$key['posttime']); ?></div>
<div class="calbottom"><?php echo date('d',$key['posttime']); ?></div>
</div>
<div class="posttop">
<h1 class="pt"><a href="<?php echo $this->baseUrl(); ?>/index/single/id/<?php echo $this->escape($key['id']) ?>"><?php echo $this->escape($key['title']) ?></a></h1><div class="edit"><a href=""><img src="<?php echo $this->baseUrl(); ?>/public/imgs/edit.gif"  /></a></div>
<a href="" class="user">Author:<?php echo $this->escape($key['author']) ?></a><a href="" class="cat">Hit(<?php echo $this->escape($key['viewnums']) ?>)</a> <a href="" class="com">Comments (<?php echo $this->escape($key['commnums']) ?>)</a>
</div>
<div class="post">
<a href="<?php echo $this->baseUrl(); ?>/index/single/id/<?php echo $this->escape($key['id']) ?>" style="TEXT-DECORATION:none"><?php echo mb_substr($key['content'],0,400,'utf-8'); ?></a>
</div>
<div class="postbottom"><a href="" class="email">Replay</a></div>
<?php } ?>

<div class="postnav">
 <?php echo $this->paginationControl($this->paginator, 'Sliding', 'page.phtml'); ?>
</div>
</div>
</div>
</div>
<?php endswitch; ?>
<?php echo $this->render('foot.html'); ?>
